package com.lcc.bank.tools.controller;

import com.lcc.bank.tools.base.bean.ResultContext;
import com.lcc.bank.tools.handle.ReturnConfiguration;
import com.lcc.bank.tools.pojo.ReturnConfigDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author lincc
 * @version 1.0 2020/6/28
 */
@Api(tags = "返回信息相关接口")
@RestController
@RequestMapping("/returnMsg")
@Slf4j
public class ReturnMsgController {

    @ApiOperation(value = "获取返回信息配置")
    @PostMapping("getReturnConfig.do")
    public ResultContext<ReturnConfigDTO> getReturnConfig() {
        return ResultContext.successData(ReturnConfiguration.returnConfigDTO);
    }

    @ApiOperation(value = "修改返回信息配置")
    @PostMapping("edit.do")
    public ResultContext edit(@ApiParam @RequestBody ReturnConfigDTO returnConfigDTO) {
        ReturnConfiguration.editConfig(returnConfigDTO);
        return ResultContext.success("操作成功");
    }
}
